package com.gticket.orderservice.service.impl;

import com.gticket.orderservice.mapper.ActualSeatMapper;
import com.gticket.orderservice.mapper.OrderItemMapper;
import com.gticket.orderservice.pojo.OrderItems;
import com.gticket.orderservice.pojo.Orders;
import com.gticket.orderservice.service.OrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 伴你时光尽头
 * @Date: 2019/11/19 17:05
 */
@Service
public class OrderItemServiceImpl implements OrderItemService {
    @Autowired
    private OrderItemMapper orderItemMapper;//自动装配
    @Autowired
    private ActualSeatMapper actualSeatMapper;

    @Override
    public Integer selectCinema_idByFs_id(OrderItems items) {

        return orderItemMapper.selectCinema_idByFs_id(items);

    }

    @Override
    public void addOrderItem(OrderItems item) {
        orderItemMapper.addOrderItem(item);//
    }

    @Override
    public String selectCinema_nameByFs_id(OrderItems items) {
        return orderItemMapper.selectCinema_nameByFs_id(items);
    }

    /**
     * 根据order_num查询所有的订单项并封装成List<OrderItems>集合返回
     *
     * @param orders 封装有数据库前缀名和order_num的Order对象
     * @return
     */
    @Override
    public List<OrderItems> getItemsByOrder_num(Orders orders) {
        return orderItemMapper.getItemsByOrder_num(orders);
    }


}
